# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=vault-scanner
_pkgname=vault
pkgver=299.0303cf4
pkgrel=8
pkgdesc='Swiss army knife for hackers.'
arch=('any')
groups=('blackarch' 'blackarch-scanner' 'blackarch-fingerprint'
        'blackarch-recon' 'blackarch-networking')
url='https://github.com/abhisharma404/vault'
license=('MIT')
depends=('python' 'python-beautifulsoup4' 'python-requests'
         'python-htmlparser' 'python-ipwhois' 'scapy' 'python-python-nmap'
         'python-pynput')
makedepends=('git')
source=("git+https://github.com/abhisharma404/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $_pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" docs/* *.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a --no-preserve=ownership src/* "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $_pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

